package lab2.text21;

/**
 * Created by Administrator on 2017/10/30.
 */
public class Text {
    public static void main(String[] args) {
        String string = "qwerqweqw";
        char i = 'q';
        int times = 0;
        for (int j = 0; j < string.length(); j++) {
            if (string.charAt(j) == i)
                times++;
        }
        System.out.println(i + "在字符串" + string + "中共出现：" + times + "次");
    }
}